﻿Imports System.Data
Imports System.Data.Odbc
Imports WSEntidades
Public Class PolizasFact
    Public Shared Function Build(ByVal dr As OdbcDataReader) As PolizasBE
        Dim tmpPolizas As PolizasBE = New PolizasBE()
        Try
            With tmpPolizas
                .Anio = convertDTFromDb.convertInt32(dr.Item("Anio"))
                .Debe = convertDTFromDb.ConvertDecimal(dr.Item("Debe"))
                .Descripcion = convertDTFromDb.ConvertString(dr.Item("Descripcion"))
                .FCancela = convertDTFromDb.convertDateTime(dr.Item("FCancela"))
                .FechaC = convertDTFromDb.convertDateTime(dr.Item("FechaC"))
                .FechaF = convertDTFromDb.convertDateTime(dr.Item("FechaF"))
                .FechaI = convertDTFromDb.convertDateTime(dr.Item("FechaI"))
                .Folio = convertDTFromDb.ConvertString(dr.Item("Folio"))
                .Folio1 = convertDTFromDb.convertInt32(dr.Item("Folio1"))
                .FPoliza = convertDTFromDb.convertDateTime(dr.Item("FPoliza"))
                .Generada = convertDTFromDb.ConvertShort(dr.Item("Generada"))
                .Haber = convertDTFromDb.ConvertDecimal(dr.Item("Haber"))
                .IdEmpresa = convertDTFromDb.ConvertShort(dr.Item("IdEmpresa"))
                .IdPoliza = convertDTFromDb.ConvertShort(dr.Item("IdPoliza"))
                .Mes = convertDTFromDb.ConvertShort(dr.Item("Mes"))
                .Status = convertDTFromDb.ConvertString(dr.Item("Status"))
                .SubTipo = convertDTFromDb.ConvertShort(dr.Item("SubTipo"))
                .TipoPol = convertDTFromDb.ConvertShort(dr.Item("TipoPol"))
                .Usr = convertDTFromDb.ConvertString(dr.Item("Usr"))
                .UsrCancela = convertDTFromDb.ConvertString(dr.Item("UsrCancela"))
            End With
            Return tmpPolizas
        Catch ex As Exception
            Throw
        Finally
            tmpPolizas = Nothing
        End Try
    End Function
End Class
